﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Empty.Master" Inherits="System.Web.Mvc.ViewPage<InfoSource.Models.ManageDoNotMarketListViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">InfoSource: Manage Do-Not-Market List</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ExtraStyleSheets" runat="server">
	<link href="/InfoSource/Content/Styles/Views/ManageDoNotMarketListView.css" rel="stylesheet"
		type="text/css" />
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="Scripts" runat="server">
	<script src="/InfoSource/Content/Scripts/Views/ManageDoNotMarketListView.js" type="text/javascript"></script>
	<script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script>

</asp:Content>

<asp:Content ID="Content5" ContentPlaceHolderID="InlineScripts" runat="server">
InfoSource.ManageDoNotMarketList.ZipCodes = <%= Model.SerializedZipCodes %>
</asp:Content>



<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">

    <div id='mainContent'>
		<div id='zipsContainer'>
		<% 
			StringBuilder output = new StringBuilder();
    		string city;
			foreach (InfoSource.Data.Do_Not_Market_List zipcode in Model.ZipCodes)
			{
				city = zipcode.colorado_zipcodes.FirstOrDefault().city;
				output.Append(string.Concat(
					"<div class='zipContainer' zip='" + zipcode.Zip + "' city='" + city + "'>"
						, "<span class='actions'>"
							, "<button class='btnDelete'>Delete</button>"
						, "</span>"
						, "<span class='zipcode'>"
							, zipcode.Zip
						, "</span>"
						, "<span class='city'>"
							,city
						, "</span>"
					, "</div>"
				));
			}

			Response.Write(output);	   
		%>
		
		<div id="addNewContainer" class="zipContainer">
			<span class='actions'>
				<button id="btnAdd">Add</button>
			</span>
			<span class='zipcode'>
				<select id="selAddNew">
					<%
						output = new StringBuilder();
						foreach (InfoSource.Data.colorado_zipcode coZip in Model.RemainingZipCodes.OrderBy(zip => zip.zip))
						{
							output.Append(string.Concat(
								"<option value='" + coZip.zip + "' city='" + coZip.city + "'>"
									, coZip.zip + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + coZip.city
								,"</option>"
							));
						}

						Response.Write(output.ToString());									
					%>
				</select>
			</span>
		</div>
		
		</div>
		
		<div id='mapContainer'>
			<div id='map_canvas'>
				map not loaded
			</div>
		</div>
    </div>

</asp:Content>


